<template>
	<view v-if="userInfo!=null">

		<cu-custom bgColor="theme-bg-color" :isBack="false">
			<block slot="backText"><text>返回</text></block>
			<block slot="content"><text> 我 的 </text></block>
		</cu-custom>
		<view class="user-info-box" v-if="userInfo!=null" @click="Join('userinfo-edit')">
			<view class="avatar-box">
				<image class="avatar" mode="aspectFill" :src="userInfo.ImageUrls||defaultHeadImage"></image>
				<view class="avatar-text">
					<view class="name">{{userInfo.Name}} </view>
					<view>
						<text
							class="cu-tag margin-top-xs bg-blue round">{{userInfo.OrganizationDto==null?'你还未加入班级':userInfo.OrganizationDto.Name}}</text>

						<text class="cu-tag margin-top-xs bg-green round text-xs" v-if="userInfo.FaceAuth">完成人脸认证</text>
						<text class="cu-tag margin-top-xs bg-grey  round text-xs"
							v-if="userInfo.FaceAuth==false">未完成人脸认证</text>
					</view>


				</view>
			</view>
			<view class="arrow-box">
			</view>
		</view>

	<!-- 	<view class="fans-box">
			<view class="fans-item">
				<view class="fans-num">{{MyAnalyseData.OrderSuccessCount}}</view>
				<view class="fans-text">有效订单</view>
			</view>
			<view class="fans-item">
				<view class="fans-num">{{MyAnalyseData.TopicCount}}</view>
				<view class="fans-text">我的话题</view>
			</view>
			<view class="fans-item">
				<view class="fans-num">{{MyAnalyseData.TopicRecordCount}}</view>
				<view class="fans-text">我的浏览</view>
			</view>

		</view> -->

		<view class="cu-list grid  col-3 margin-top margin-tb-sm">


			<view class="cu-item" :class="false?'arrow':''" @click="Join('userinfo-edit')">
				<view class="content">
					<text class=" iconfont icon-yonghu text-grey" style="font-size: 40upx;"></text>
					<text class=" text-gray " style="padding-left:10upx">个人信息</text>
				</view>
			</view>


			<view class="cu-item" :class="false?'arrow':''" @click="Join('/pages/Organization/Organization')">
				<view class="content">
					<text class="iconfont icon-order text-grey" style="font-size: 40upx;"></text>
					<text class="text-gray" style="padding-left:10upx">绑定班级</text>
				</view>
			</view>
			<view class="cu-item" :class="true?'arrow':''" @click="Join('/pages/user-center/MyFace')">
				<view class="content">
					<text class="iconfont icon-huati text-grey" style="font-size: 40upx;"></text>
					<text class="text-gray" style="padding-left:10upx">上传人脸</text>
				</view>
			</view>
			<view class="cu-item" :class="false?'arrow':''" @click="Join('/pages/LeaveRecord/LeaveRecord')">
				<view class="content">
					<text class="iconfont icon-order text-grey" style="font-size: 40upx;"></text>
					<text class="text-gray" style="padding-left:10upx">我要请假</text>
				</view>
			</view>
			<view class="cu-item" :class="false?'arrow':''" @click="Join('/pages/Check/MyNeedRepList')">
				<view class="content">
					<text class="iconfont icon-chengjiluru text-grey" style="font-size: 40upx;"></text>
					<text class="text-gray" style="padding-left:10upx">缺勤记录</text>
				</view>
			</view>
			
			

		</view>



		<button style="margin:30upx" class="cu-btn block theme-bg-color margin-tb-sm lg" @click="loginOut">退出</button>
		<footer-bar :currentIndex="1"></footer-bar>
		<view style="height: 200upx;"></view>

	</view>



</template>

<script>
	import store from "@/store";
	import {
		mapGetters
	} from "vuex";
	export default {
		components: {

		},
		data() {
			return {
				defaultHeadImage: require('@/static/head.png'),
				ActivityCount: "-",
				TopicCount: "-",
				MyAnalyseData: {
					IntegralRecordCount: "0",
					LaundryPointCollectCount: "0",
					OrderCount: "0"

				},
				chartsDataColumn2: null,
			}
		},
		computed: {
			...mapGetters([
				'token', 'RoleTypeFormat', "userInfo",
			])
		},
		onShow() {

			if (this.$comm.CheckToken()) {

				this.getUserInfo();
				// this.GetMyAnalyse();

			}
		},
		methods: {

			async getUserInfo() {
				await this.$store.dispatch("UserInfoByToken");

			},
			async GetMyAnalyse() {
				if (this.$comm.CheckToken()) {
					let {
						Data,
						Success,
					} = await this.$http.PostAsync("/Analyse/MyData", {
						UserId: this.userInfo.Id,
					});
					if (Success) {
						this.MyAnalyseData = Data;
					}
				}
			},
			loginOut() {
				this.$store.dispatch("TokenLose");

			},
			async Join(url) {
				uni.navigateTo({
					url: url
				})
			},

		}
	}
</script>

<style scoped>
	/* 用户信息部分 */
	.user-info-box {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		height: 200rpx;
	}

	.avatar-box {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		align-items: center;
		padding-left: 40rpx;
	}

	.avatar-box .avatar {
		width: 116rpx;
		height: 116rpx;
		border-radius: 116rpx;
	}

	.avatar-box .avatar-text {
		padding-left: 20rpx;
	}

	.avatar-text .name {
		font-size: 50rpx;
		font-weight: 500;
		color: #000002;
	}

	.avatar-text .desc {
		color: #a0a1a3;
		padding-top: 10rpx;
		font-size: 30rpx;
	}

	.arrow-box {
		width: 20rpx;
		height: 20rpx;
		border-top: 3rpx solid #a9acb3;
		border-right: 3rpx solid #a9acb3;
		transform: rotate(45deg);
		margin-right: 40rpx;
	}

	.fans-box {
		display: flex;
		justify-content: space-around;
		align-items: center;
	}

	.fans-item {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.fans-num {
		font-size: 40rpx;
		font-weight: bold;
		color: #000002;
		margin-bottom: 20rpx;
	}

	.fans-text {
		font-size: 35rpx;
		color: #919294;
	}

	.usual-ability-box {
		margin-top: 30rpx;
		background-color: #fff;
		padding: 35rpx 55rpx;
	}

	.b-fixed {
		position: fixed;
		bottom: 300upx;
		right: 20upx;

		height: 100upx;
		padding: 20upx;

	}
</style>